package com.wf.day_0608.test2;

import com.wf.day_0608.test1.Ticket;

/**
 * @author mpk
 * @since 2024/6/8 20:51:54
 */
public class Gift extends Thread {

    int gift = 100;

    @Override
    public void run() {


            while (true) {
                synchronized (Gift.class) {
                    if (gift < 10) {
                        break;
                    } else {

                        System.out.println(Thread.currentThread().getName() + "送出了第" + gift-- + "件礼物");


                    }
                }



        }
    }
}
